package Application.Mirrors;

import Application.AppJoint;
import Application.Layer.Layer;
import Application.Layer.LayerDelegate;

public class FrontColorMirror {
    private static FrontColorMirror ins  = new FrontColorMirror();
    public static FrontColorMirror getInstance(){
        return ins;
    }

    public void frontColorMirrorActivited(Layer layer){
        int height  = AppJoint.getInstance().getCanvasHeight();
        int width = AppJoint.getInstance().getCanvasWidth();

        int argb = AppJoint.getInstance().getFrontColorArgb();
        int ans;

//        int a = (argb >> 24) &(0xff);
//        int r = (argb >> 16) &(0xff);
//        int g = (argb >> 8) &(0xff);
//        int b = (argb);

        for(int i=0;i<width;i++){
            for(int j=0;j<height;j++){
                layer.setArgb(i,j,argb);
            }
        }

        LayerDelegate.getInstance().refreshAll();
        AppJoint.getInstance().flush();
    }
}
